 /// @file InterOpPMINote.h
 /// @brief InterOpPMINote 
 /// @copyright Copyright (c) 2025  Hefei Jiushao Intelligent Technology Co., Ltd. All rights reserved.
 /// @createtime 2025-04-07

#ifndef INTEROPPMINOTE_H
#define INTEROPPMINOTE_H
#include "InterOpPMIBase.h"
#include <vector>

namespace  AMCAX::Exchange::InterOp::PMI {

    /// Enum for font type of text annotation.
    enum PMIFont
    {
        Simplex,
        Din,
        Military,
        ISO,
        Lightline,
        Century,
        IGES_1001,
        IGES_1002,
        IGES_1003
    };

    #define IS_InterOpNote(BasePtr) IS_DERIVED_SHARED_PTR(BasePtr, AMCAX::Exchange::InterOp::PMI::InterOpNote)
    #define Cast_InterOpNote(BasePtr) SAFE_SHARED_PTR_CAST(BasePtr, AMCAX::Exchange::InterOp::PMI::InterOpNote)
    class InterOpNote : public InterOpPMIAnnotation
    {
    public:
        ~InterOpNote() = default;

        struct Text{
            /// The string value of the label associated with this text.
            std::string label ;
            /// The name of the font associated with this text.
            std::string fontName ;
            /// 
            PMIFont fontType ;
            /// Denotes whether the text note has a fixed pitch.
            bool fixedPitch ;
            /// The height of the text note.
            float height ;

            /// Denotes whether the text note is bold.
            bool bold ;

            /// Denotes whether the text note is italic.
            bool italic ;
            /// Denotes whether the text note is underlined.
            bool underline ;

            /// Denotes whether the text note has strike through.
            bool strikeThrough ;

            /// Denotes whether the text note has an over line.
            bool overline ;

            /// The ratio of the text note.
            float ratio ;

            /// The slant of the text note.
            float slant ;

            /// The color of the text note.
            double rgbaColor[4] ;
        } ;

        /// @brief Obtain the type of this annotation.
        /// @return 
        ///		Type: PMIAnnotationType::Note.
        virtual PMIAnnotationType GetType() const 
        {
            return PMIAnnotationType::Note;
        } 

        /// @brief Set the flag of the note
        /// @param[in] isFlagNote: if this field is true, it means this note is a Flag Note.

        void SetIsFlagNote(bool isFlagNote) {
            this->isFlagNote = isFlagNote ;
        } ;

        /// @bref Set the flag of the note
        /// @param[in] isNOA: This note is a Note Object Atttribute(NOA).
        void SetIsNOA(bool isNOA) {
            this->isNOA = isNOA ;
        } ;

        /// @brief Add text to the note
        /// @param[in] text: The text to be added to the note.
        /// @return NONE        
        void AddText(const Text &text) {
            noteTexts.push_back(text) ;
        } ;

        /// @brief Get the note type string.
        /// @return The note type.
        const std::string& GetNoteType() const {
            return noteType;
        }

        /// @brief Get the texts of the note.
        /// @return The vector of Text structs.
        const std::vector<Text>& GetNoteTexts() const {
            return noteTexts;
        }

        /// @brief Check if this note is a Flag Note.
        /// @return True if it is a Flag Note, false otherwise.
        bool GetIsFlagNote() const {
            return isFlagNote;
        }

        /// @brief Check if this note is a Note Object Attribute (NOA).
        /// @return True if it is NOA, false otherwise.
        bool GetIsNOA() const {
            return isNOA;
        }
    private:

        std::string noteType ;
        std::vector<Text>  noteTexts ;
        /// if this field is true, it means this note is a Flag Note.
        bool isFlagNote ;
        /// This note is a Note Object Atttribute(NOA).
        bool isNOA ;
    };
}

#endif